package com.hnyc.service.impl;

import com.hnyc.domain.CandConstants;
import com.hnyc.domain.CandUser;
import com.hnyc.domain.CandUserRole;
import com.hnyc.exception.ServiceException;
import com.hnyc.mapper.CandUserMapper;
import com.hnyc.mapper.CandUserRoleMapper;
import com.hnyc.service.ICandUserRoleService;
import com.hnyc.service.ICandUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;

/**
 * @Author: XieYingHao
 * @date: 2023/7/1 11:06
 */
@Service
public class CandUserRoleServiceImpl implements ICandUserRoleService {


    @Resource
    private CandUserRoleMapper candUserRoleMapper;

    /**
     * 新增用户角色信息
     * @param userRole 用户角色对象
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertUserRole(CandUserRole userRole) {
        userRole.setStatus(1);
        System.out.println(userRole);
        return candUserRoleMapper.batchUserRole(userRole);
    }
}
